import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2024-12-01
 * Time: 9:51
 */
public class OldKeyboard {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String str1 = in.nextLine();
            String str2 = in.nextLine();
            getError(str1,str2);
        }
    }
    private static void getError(String str1,String str2) {
        str1 = str1.toUpperCase();
        str2 = str2.toUpperCase();
        Set<Character> normalSet = new HashSet<>();
        for (int i = 0; i < str2.length(); i++) {
            char ch = str2.charAt(i);
            normalSet.add(ch);
        }
        Set<Character> errorSet = new HashSet<>();
        for (int i = 0; i < str1.length(); i++) {
            char ch = str1.charAt(i);
            if (!errorSet.contains(ch) && !normalSet.contains(ch)) {
                errorSet.add(ch);
                System.out.print(ch);
            }
        }
    }
}
